import { createStore } from 'vuex'

export default createStore({
  state: {
    pageName: '电影管理',
    // 控制电影管理页面中的AdminMoviesDialog中的打开的Dialog打开和关闭
    editDialogVisible: false,
    delDialogVisible: false,
    // 控制场次列表管理页面的AdminArrangmentDialog中的Dialog打开和关闭
    ArrAddOrEditDV: false,
    ArrDelDV: false,
    // 用户管理页面Dialog的控制
    editUserDialogVisible: false,
    delUserDialogVisible: false,
    // 实现超级管理员和普通管理员的不同权限
    admin: false,
    // 是否显示一开始的默认电影页面
    isHome: true
  },
  mutations: {
    setIsHome(state, val) {
      state.isHome = val
    },
    setAdmin(state, val) {
      state.admin = val
    },
    setEditUserDialogVisible(state, val) {
      state.editUserDialogVisible = val
    },
    setDelUserDialogVisible(state, val) {
      state.delUserDialogVisible = val
    },
    setMenu(state, val) {
      state.menu = val
    },
    setPageName(state, val) {
      state.pageName = val
    },
    setEditDialogVisible(state, val) {
      state.editDialogVisible = val
    },
    setDelDialogVisible(state, val) {
      state.delDialogVisible = val
    },
    setArrAddOrEditDV(state, val) {
      state.ArrAddOrEditDV = val
    },
    setArrDelDV(state, val) {
      state.ArrDelDV = val
    }
  },
  actions: {},
  modules: {}
})
